/**
 * Created by hahay on 2018/7/3.
 */

import request from '@/utils/request'

const apis = {
  INDEX: '/appreslist/get/18',
  GET_COURSE: '/course/getcourse',
  GET_COURSE_LIST: '/course/getcourselist',
  GET_INDEX: '/specific/getmobilehomepage',
  GET_MY_COURSE_LIST: '/personalcenter/getmycourse',
  START_LEARNING: '/course/startlearning',
  GET_ANOTHER_LEVEL: '/course/getanotherlevel',
  GET_LESSON_LIST: '/course/getlessonlist',
  GET_REPLY_LIST: '/course/getreplylist',
  GET_PALY_BACKTIME: '/lesson/getplaybacktime',
  MODIFY_PLAY_BACKTIME: '/lesson/modifyplaybacktime',
  GET_LESSON: '/lesson/getlesson',
  ADDREPLY: '/course/addreply',
  SUPCOUNT: '/course/getthumbsupcount',
  IS_SUP: '/course/getthumbsup',
  ChANGE_SUP: '/course/togglethumbsup',
  MY_ANSWER_LIST: '/personalcenter/getmyanswerlist',
  ADD_MY_QUESTION: '/personalcenter/addmyquestion',
  GET_FINAL_SCORE: '/exercise/getfinalscore'
}

export default {
  // 信息列表
  Index (data) {
    let dt = data || {}
    return request.post(apis.INDEX, dt.params, {
      headers: dt.headers || {}
    })
  },
  getCourse (data) {
    let dt = data || {}
    return request.post(apis.GET_COURSE, dt.params, {
      headers: dt.headers || {}
    })
  },
  getCourseList (data) {
    let dt = data || {}
    return request.post(apis.GET_COURSE_LIST, dt.params, {
      headers: dt.headers || {}
    })
  },
  getIndex (data) {
    let dt = data || {}
    return request.post(apis.GET_INDEX, dt.params, {
      headers: dt.headers || {}
    })
  },
  getMyCourseList (data) {
    let dt = data || {}
    return request.post(apis.GET_MY_COURSE_LIST, dt.params, {
      headers: dt.headers || {}
    })
  },
  startLearning (data) {
    let dt = data || {}
    return request.post(apis.START_LEARNING, dt.params, {
      headers: dt.headers || {}
    })
  },
  getAnotherLevel (data) {
    let dt = data || {}
    return request.post(apis.GET_ANOTHER_LEVEL, dt.params, {
      headers: dt.headers || {}
    })
  },
  getLessonList (data) {
    let dt = data || {}
    return request.post(apis.GET_LESSON_LIST, dt.params, {
      headers: dt.headers || {}
    })
  },
  getReplyList (data) {
    let dt = data || {}
    return request.post(apis.GET_REPLY_LIST, dt.params, {
      headers: dt.headers || {}
    })
  },
  getPlayBacktime (data) {
    let dt = data || {}
    return request.post(apis.GET_PALY_BACKTIME, dt.params, {
      headers: dt.headers || {}
    })
  },
  modifyPlayBacktime (data) {
    let dt = data || {}
    return request.post(apis.MODIFY_PLAY_BACKTIME, dt.params, {
      headers: dt.headers || {}
    })
  },
  getLesson (data) {
    let dt = data || {}
    return request.post(apis.GET_LESSON, dt.params, {
      headers: dt.headers || {}
    })
  },
  addreply (data) {
    let dt = data || {}
    return request.post(apis.ADDREPLY, dt.params, {
      headers: dt.headers || {}
    })
  },
  getSupCount (data) {
    let dt = data || {}
    return request.post(apis.SUPCOUNT, dt.params, {
      headers: dt.headers || {}
    })
  },
  isSup (data) {
    let dt = data || {}
    return request.post(apis.IS_SUP, dt.params, {
      headers: dt.headers || {}
    })
  },
  changeSup (data) {
    let dt = data || {}
    return request.post(apis.ChANGE_SUP, dt.params, {
      headers: dt.headers || {}
    })
  },
  getMyAnswerList (data) {
    let dt = data || {}
    return request.post(apis.MY_ANSWER_LIST, dt.params, {
      headers: dt.headers || {}
    })
  },
  addMyQuestion (data) {
    let dt = data || {}
    return request.post(apis.ADD_MY_QUESTION, dt.params, {
      headers: dt.headers || {}
    })
  },
  getFinalScore (data) {
    let dt = data || {}
    return request.post(apis.GET_FINAL_SCORE, dt.params, {
      headers: dt.headers || {}
    })
  }
}
